import { match } from 'path-to-regexp';
const genURL = (path) => (path instanceof URL ? path : new URL(path, window.location.href));
export default function (path) {
    const url = genURL(path);
    const matcher = match(url.pathname, { decode: decodeURIComponent });
    return (input) => {
        input = genURL(input);
        return input.origin === url.origin && matcher(input.pathname);
    };
}
